﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using System.Xml;
using System.Collections.ObjectModel;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace WcfServiceLibrary2
{
   
    [ServiceContract]
    public interface IService1
    {
        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json,Method="GET",UriTemplate="GetData/{value}",BodyStyle=WebMessageBodyStyle.WrappedRequest)]
        string GetData(String value);
        [OperationContract]
        List<LoaiHang> GetAllLoaiHang();
        [OperationContract]
        string GetByteFromString(byte[] data);
        [OperationContract]
        string GetStringFromStream(FileData fileDate);
        [OperationContract]
        ImageData GetImageData(string path);
        [OperationContract]
        List<ImageData> GetImagePath();
        [OperationContract]
        [WebInvoke(ResponseFormat=WebMessageFormat.Json,BodyStyle=WebMessageBodyStyle.Wrapped)]
        void MoveFile(string destinationFileName, byte[] fileData);
        [OperationContract]
        Stream SendStream(string data);
        [OperationContract]
        string GetStringByStream(Stream data);
        
       
        
        [OperationContract]
        byte[] SendImage(byte[]data);
        [OperationContract]
        void ImageInsert(Image newImage);
        [OperationContract]
        Image ImageGetByID(int id);
        [OperationContract]
        List<Image> ImageGetAll();
        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, Method = "POST", UriTemplate = "SinhvienInsert")]
        int SinhvienInsert(SinhVien sinhvien);
       
        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
        void Configgurations(string user, string password, string database, string datasource);
        [OperationContract]
        int demsonguoiconnect();
        [OperationContract(IsOneWay = true)]
        void DoSomething();
        [OperationContract]
       
        void insertAnh(Anh anh);
        [OperationContract]
        List<Anh> GetAllAnh();
        [OperationContract]
        Anh GetAnhById(int id);
        [OperationContract]
        ObservableCollection<SinhVienHoc> GetAllSinhVienHoc();
        
        
       
        [OperationContract(IsOneWay=true)]
        void OneWay(int milisecond);
        [OperationContract]
        //[WebInvoke(UriTemplate = "/Login?name={name}&pass={pass}")]
        [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "Login?name={name}&pass={pass}")]
        String Login(String name,string pass);
        [OperationContract]
        [WebInvoke(ResponseFormat=WebMessageFormat.Json)]
        String JsonRequest(string request);
        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, Method = "POST",UriTemplate="VanhungJson")]
        List<MatHang> VanhungJson(LoaiHang vanhung);

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, Method = "POST", UriTemplate = "TestArray")]
        String TestArray(String name, String age);

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, Method = "POST", UriTemplate = "TestArrayObject")]
        String TestArrayObject(Vanhung vanhung,VanHungJson vanhungjson);

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, Method = "POST", UriTemplate = "TestArrayObjectAndString")]
        String TestArrayObjectAndString(Vanhung vanhung,String name );

        [OperationContract]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, Method = "POST", UriTemplate = "HelloWord")]
        String HelloWord();
        
    }

    
    
}
